obs-browser: prevent race condition in CEF paint pipeline#138
Closed
zavitax wants to merge 1 commit intoobsproject:masterfrom
Closed
obs-browser: prevent race condition in CEF paint pipeline#138zavitax wants to merge 1 commit intoobsproject:masterfrom
zavitax wants to merge 1 commit intoobsproject:masterfrom
Conversation
* WasHidden & CloseBrowser are now called before bc->bs is dereferenced to disable calls to GetViewRect(), OnPaint() & OnAcceleratedPaint() earlier. * WasHidden, CloseBrowser, Invalidate, SendProcessMessage are now called on the current thread: execution on CEF UI thread is not required for those calls. * In CEF paint pipeline (GetViewRect, OnPaint, OnAcceleratedPaint): Save the value of bc->bs befpre checking if it's valid to prevent the condition where bc->bs is checked for validity and immediately invalidated in a parallel thread.
Contributor
Author
|
This PR resolves the following crash. |
| Json json; | ||
|
|
||
| if (!bs) { | ||
| BrowserSource* source = bs; |
There was a problem hiding this comment.
What is the purpose of doing this?
Contributor
Author
There was a problem hiding this comment.
I have seen crashes in the wild where !bs check was completed successfully but crashes downstream on bs-> usage. This suggests bs might be invalidated in a parallel thread right after the !bs check completed.
Member
|
Is this still a problem with the current codebase and modern CEF builds? |
Member
|
@RytoEX can probably be closed as there was no confirmation (for either possibility) in 3 years now. |
Member
|
Agreed. If this is still an issue, it can be reopened or resubmitted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dereferenced to disable calls to GetViewRect(), OnPaint() &
OnAcceleratedPaint() earlier.
are now called on the current thread: execution on CEF UI thread
is not required for those calls.
Save the value of bc->bs befpre checking if it's valid to prevent the
condition where bc->bs is checked for validity and immediately
invalidated in a parallel thread.